package com.atguigu.yygh;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 比糖
 * @DATE
 */

@Data
@AllArgsConstructor //有参构造方法
@NoArgsConstructor //无参构造方法
public class RespBean {
    private long code; // 状态码
    private String message; // 返回信息
    private Object data; // 返回数据

    public static RespBean success(String message){
        return new RespBean(200,message,null);
    }

    public static RespBean success(String message,Object data){
        return new RespBean(200,message,data);
    }

    public static RespBean error(String error){
        return new RespBean(500,error,null);
    }

    public static RespBean error(String error,Object data){
        return new RespBean(500,error,data);
    }
}
